import request from '@/utils/request'

const api_name = '/hr/service/user'

export default {
  getUserListPage(current, limit, userName) {
    return request({
      url: `${api_name}/users/${current}/${limit}`,
      method: 'get',
      params: { userName }
    })
  },
  getUser(id) {
    return request({
      url: `${api_name}/user`,
      method: 'get',
      params: { id }
    })
  },
  addUser(user) {
    return request({
      url: `${api_name}/user`,
      method: 'post',
      data: user
    })
  },
  updateUser(user) {
    return request({
      url: `${api_name}/user`,
      method: 'put',
      data: user
    })
  },
  deleteUser(id) {
    return request({
      url: `${api_name}/user/${id}`,
      method: 'delete'
    })
  }

}
